
const setHttp = require('../../bubaocloud/service/request.js').setHttp;

let service = {

  /**
   * 每日更新运势
   */
  getConstellation: () => {
    return setHttp(
      'api/bubble/constellation/init',
      null
    )
  },

  /**
   * 建立好友关系
   */
  setFriend: (openId) => {
    return setHttp(
      `api/bubble/constellation/friend?openId=${openId}`,
      null,
      'post'
    )
  },

  /**
   * 设置生日
   */
  setBornDate: (birth) => {
    return setHttp(
      'api/bubble/constellation/birth',
      {
        birth
      },
      'post'
    )
  },

  /**
   * 获取生日
   */
  getBornDate: () => {
    return setHttp(
      'api/bubble/constellation/birth/get',
      null
    )
  },


  /**
   * 获取好友星座信息
   */
  getFriendsZodiac: () => {
    return setHttp(
      'api/bubble/constellation/get',
      null
    )
  },

  /**
   * 得到已收集了多少个星座
   */
  getZodiacCount: () => {
    return setHttp(
      'api/bubble/constellation/collent',
      null
    )
  },

  /**
   * 得到星座下的好友
   */
  getUserFormZodiac: (id) => {
    return setHttp(
      `api/bubble/constellation/${id}/friend`,
      null
    )
  },

  /**
   * 获取运势详情
   */
  getFate: () => {
    return setHttp(
      'api/bubble/constellation/fate',
      null
    )
  },

  /**
   * 领奖
   */
  packet: () => {
    return setHttp(
      'api/bubble/constellation/packet',
      null
    )
  },

  getShareDetail: (url = "Constellation/share.json") => {
    return setHttp(
      url,
      null
    )
  }
}

module.exports = service;